package com.lxs.spring6.boot3.schedule;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ScheduleController {
    @Autowired
    private ScheduleTask scheduleTask;

    @RequestMapping("/updateCron")
    public String updateCron(String cron) {
        System.err.println("old cron :{}" + scheduleTask.getCron());
        System.err.println("new cron :{}" + cron);
        scheduleTask.setCron(cron);
        return "ok";
    }
}
